<!--
 * @Author: ljc
 * @Date: 2023-04-27 17:11:02
 * @LastEditors: g05047
 * @LastEditTime: 2023-05-10 09:06:11
 * @Description: 基本信息
-->
<template>
  <div class="rk-form-base-conf-body">
    <task-detaile-base ref="taskDetileBaseViewRef"
      :isDisabled="isDisabled"
      :taskDetaileData="taskDetaileData"></task-detaile-base>
  </div>
</template>

<script setup >
import XEUtils from 'xe-utils'
import TaskDetaileBase from '../../dialogs/components/TaskDetaileBase.vue'
import { EXPERT_INPUT_STATUS } from '@/enums/enums-expert.js'
import { ref } from 'vue'

const props = defineProps({
  taskDetaileData: { type: [Object], default: () => ({}) }
})
const isDisabled = ref(false)
const taskDetileBaseViewRef = ref()
const baseConfForm = reactive({})
watch(
  () => props.taskDetaileData,
  (newValue, oldValue) => {
    nextTick(() => {
      if (!XEUtils.isEmpty(newValue)) {
        baseConfForm.value = newValue
      } else {
        baseConfForm.value = {}
      }
    })
  },
  { deep: true, immediate: true }
)

const getFormData = async function () {
  const baseData = await taskDetileBaseViewRef.value.handleBaseFromData()
  console.log(baseData)
  return baseData
}
const resetFormData = function () {
  taskDetileBaseViewRef.value.resetForm()
}

defineExpose({
  getFormData,
  resetFormData
})

</script>

<style lang="scss" scoped>
.rk-form-base-conf-body {
  height: 100%;
  background-color: #fff;
  padding-top: 50px;
  width: 80%;
  margin: 0 auto;
}
</style>
